From: Keir Fraser Date: Tue, 23 Sep 2008 16:11:33 +0000 (+0100) Subject: hvm, save/restore: Skip page batches which contain no valid pages. X-Git-Tag: archive/raspbian/4.8.0-1+rpi1~1^2~14101^2~34 X-Git-Url: https://dgit.raspbian.org/%22http://www.example.com/cgi/%22/%22http:/www.example.com/cgi/%22?a=commitdiff_plain;h=c2c102907073dbdd468e72e58dd4bc855a404e65;p=xen.git hvm, save/restore: Skip page batches which contain no valid pages. Signed-off-by: Keir Fraser --- diff --git a/tools/libxc/xc_domain_save.c b/tools/libxc/xc_domain_save.c index c6e1c23c32..c1ced27d98 100644 --- a/tools/libxc/xc_domain_save.c +++ b/tools/libxc/xc_domain_save.c @@ -1115,7 +1115,20 @@ int xc_domain_save(int xc_handle, int io_fd, uint32_t dom, uint32_t max_iters, goto out; } - if ( !hvm ) + if ( hvm ) + { + /* Look for and skip completely empty batches. */ + for ( j = 0; j < batch; j++ ) + if ( (pfn_type[j] & XEN_DOMCTL_PFINFO_LTAB_MASK) != + XEN_DOMCTL_PFINFO_XTAB ) + break; + if ( j == batch ) + { + munmap(region_base, batch*PAGE_SIZE); + continue; /* bail on this batch: no valid pages */ + } + } + else { /* Get page types */ for ( j = 0; j < batch; j++ )